package com.zk.springbootdemo.controller;

import com.zk.springbootdemo.config.ConfigBean;
import com.zk.springbootdemo.config.UserConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableConfigurationProperties(value = UserConfig.class)
public class LucyController {
    @Autowired
    private ConfigBean configBean;
    @Autowired
    private UserConfig userConfig;

    @RequestMapping("/lucy")
    public String miya(){
        return configBean.toString();
    }

    @RequestMapping("/user")
    public String user(){
        return userConfig.toString();
    }

}
